pif_LongInt

by Popisfizzy
Double, triple, and quadruple-precision integers, both signed and unsigned.
ID:2280247
 
Resolved
Signed32 and Unsigned32 would sometimes be set to 65536 instead of 0 when using certain arguments in the constructor, despite the specification designating those arguments as setting them to 0.
BYOND Version:511
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 54.0
Applies to:DM Language
Status: Resolved (b1.1.1.20170806)

This issue has been resolved.
Descriptive Problem Summary:
Signed32 and Unsigned32 will sometimes be set to 65536 on initialization with arguments that should set it to zero. Refer to the code snippet below for demonstration.

Error found by Reformist and reported to me by pager.

Numbered Steps to Reproduce Problem:
Refer to the code snippet below

Code Snippet (if applicable) to Reproduce Problem:
mob/Login()
var/pif_LongInt
Signed32/S = new(null)
Unsigned32/U = new(null)

world << S.Print()
world << U.Print()


Expected Results:
That both lines would output 0, per the specification.

Actual Results:
Both lines output 65536.

Workarounds:
Use other argument formats to indicate 0.
Popisfizzy changed status to 'Verified'
Popisfizzy resolved issue with message:
Signed32 and Unsigned32 would sometimes be set to 65536 instead of 0 when using certain arguments in the constructor, despite the specification designating those arguments as setting them to 0.

Thanks goes to Reformist for finding the source of the error and reporting it to me.