-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Please add a function that converts a float64 to a signed 32-bit integer, compatable with lsl. It would be equivilant to
in luau:
function bit32.s32(n: number)
return (math.modf(n) + 0x8000_0000) % 0x1_0000_0000 - 0x8000_0000
end
in c:
double s32(double n) {
return (double)(s32)n;
}
Code that dealt with integers >= 0x8000_0000 behave differently in lsl and luau, due to s32 wrapping. I imagine there's already a function like this for the lsl compiler, but exposing it to slua scripters would be helpful for converting old scripts
https://secondlife.canny.io/admin/board/slua-alpha/p/function-to-simulate-int32-wrapping
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels