Page MenuHomeFeedback Tracker

Math.Floor doesn't work correctly for some numbers
Assigned, NormalPublic

Description

Numbers get clamped to 1.70141e+38

Can be worked-around by using -Math.Ceil(-number) instead.

Example:

> Math.Floor(float.MAX);
1.70141e+38  // Half of what it should be (7effffff, should be 7f7fffff)
> -Math.Ceil(-float.MAX);
3.40282e+38  // Correct result

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Modding

Event Timeline

lava76 created this task.Jan 8 2024, 2:23 PM
Geez changed the task status from New to Assigned.Jan 9 2024, 11:34 AM
lava76 renamed this task from Math.Floor doesn't work correctly for some negative numbers to Math.Floor doesn't work correctly for some numbers.Jan 9 2024, 2:27 PM
lava76 updated the task description. (Show Details)
This comment was removed by Geez.
Geez added a subscriber: Geez.Mar 6 2024, 11:12 AM