Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

sincosf returns (0, 1) on PI instead of (0, -1) #228

Closed
@CryZe

Description

@CryZe

I'm currently porting euclid to no_std and I noticed that the test for 180 degree rotations seems to fail. The problem does indeed seem to be due to the sincosf implementation in libm which returns (0, 1) on sincosf(PI) instead of (0, -1). I didn't test much further yet. sincos seems unaffected. cosf itself also returns the proper -1.

Update: It calls k_cosf(PI - S2PIO2) where S2PIO2 = PI, therefore it simplifies to k_cosf(0.0), which returns 1, which is then directly returned without modification, which seems wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions