2016-05-29 04:54:38 +02:00
|
|
|
Test default serializer:
|
|
|
|
|
obj.to_string(standard)=0.5
|
|
|
|
|
Test default serializer with custom userdata:
|
|
|
|
|
obj.to_string(userdata)=0.5
|
|
|
|
|
Test explicit serializer with custom userdata:
|
|
|
|
|
obj.to_string(custom)=test
|
|
|
|
|
Test reset serializer:
|
|
|
|
|
obj.to_string(reset)=0.5
|
2019-12-27 15:07:00 +08:00
|
|
|
Test no zero reset serializer:
|
|
|
|
|
obj.to_string(reset)=3.1415000000000002
|
2017-06-18 18:04:49 +00:00
|
|
|
obj.to_string(default format)=0.52381
|
|
|
|
|
obj.to_string(with global format)=x0.524y
|
|
|
|
|
obj.to_string(with thread format)=T0.52X
|
2017-06-18 18:34:41 +00:00
|
|
|
obj.to_string(long thread format)=Ttttttttttttt0.52xxxxxxxxxxxxxxxxxxX
|
|
|
|
|
obj.to_string(back to global format)=x0.524y
|
|
|
|
|
obj.to_string(back to default format)=0.52381
|
2017-12-24 13:45:52 -05:00
|
|
|
obj(12.0).to_string(default format)=12.0
|
|
|
|
|
obj(12.0).to_string(%.0f)=12
|
|
|
|
|
obj(12.0).to_string(%.0g)=1e+01
|
|
|
|
|
obj(12.0).to_string(%.1g)=12.0
|
2019-05-28 02:44:22 +00:00
|
|
|
obj(-12.0).to_string(default format)=-12.0
|
2019-11-22 22:56:33 -05:00
|
|
|
obj(0.0/0.0)=NaN
|
|
|
|
|
obj(1.0/0.0)=Infinity
|
|
|
|
|
obj(-1.0/0.0)=-Infinity
|