Math.convert_angle() - odd behaviour?
larcky <[email protected]> Mon, 11 Feb 2019 05:54:47 -0700 (MST)
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all
Is this right? Math.convert_angle() seems silently to convert an int to a
float rather than throw an error.
Pike v8.0 release 498 running Hilfe v3.5 (Incremental Pike Frontend)
> Math.convert_angle(40, "deg", "rad");
(1) Result: 0.698131700356801
> int a = Math.convert_angle(40, "deg", "rad");
> a;
(2) Result: 0.698131700356801
> intp(a);
(3) Result: 0
> floatp(a);
(4) Result: 1
> write("%d\n", a);
HilfeError: Error while outputting data.
sprintf: Wrong type for argument 2: expected integer, got float.
Thanks.
--
Sent from: http://pike.1058338.n5.nabble.com/Pike-User-f4601254.html