View Issue Details

IDProjectCategoryView StatusLast Update
0030023RunnerFunctionsPublic2018-10-25 15:12
ReporterYellowAfterlifeAssigned ToMike Dailly 
PriorityLowSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
PlatformWindowsOSWindows 10 ProOS Version>=1703
Product Version2.1.5 
Target Version2.2.1Fixed in Version2.2.1 
Summary0030023: Functions: giving a string to buffer_write(_, buffer_u64, _) silently casts string->double->int64, losing precision
DescriptionShould probably throw a type error, or at least cast correctly. But preferably a type error - a sign of you messing up.

Code:
var b = buffer_create(16, buffer_fixed, 1);
var str = "485038903695245323";
var orig = int64(str);
buffer_write(b, buffer_u64, str);
show_debug_message("write:" + string(orig));
buffer_seek(b, buffer_seek_start, 0);
var next = buffer_read(b, buffer_u64);
show_debug_message("read:" + string(next));
show_debug_message("equals:" + string(next == orig));


Output:
write:485038903695245323
read:485038903695245312
equals:0
TagsBuffers, functions, Runner
1.4 Found In
2.x Runtime Found In9.9.1.1180
2.x Runtime Verified In2.2.1.268

Activities

YellowAfterlife

2018-09-18 10:42

Developer  

a_bug.yyz (49,170 bytes)

Mike Dailly

2018-10-08 14:44

Developer   ~0061728

fixed