Skip to content

prevfloat/nextfloat for args <= 0 #5025

Closed
@nolta

Description

julia> nextfloat(0.)
5.0e-324

julia> prevfloat(0.)
NaN

julia> z = BigFloat(0.)
0e+00 with 256 bits of precision

julia> nextfloat(z)
2.382564904887951073216169781732674520415196125559239787955023752600945386104324e-323228497 with 256 bits of precision

julia> prevfloat(z)
-2.382564904887951073216169781732674520415196125559239787955023752600945386104324e-323228497 with 256 bits of precision

julia> nextfloat(-1.)
-1.0000000000000002

julia> prevfloat(-1.)
-0.9999999999999999

julia> z = BigFloat(-1.)
-1e+00 with 256 bits of precision

julia> nextfloat(z)
-9.999999999999999999999999999999999999999999999999999999999999999999999999999914e-01 with 256 bits of precision

julia> prevfloat(z)
-1.000000000000000000000000000000000000000000000000000000000000000000000000000017e+00 with 256 bits of precision

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