[Issue 6486] New: std.math.abs(BigInt)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 12 15:25:48 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6486
Summary: std.math.abs(BigInt)
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: enhancement
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-08-12 15:25:47 PDT ---
I'd like to use std.math.abs on a BigInt too:
import std.bigint, std.math;
void main() {
auto r = abs(BigInt(-1000));
}
But dmd 2.054 gives:
...\src\phobos\std\math.d(251): Error: pure function 'abs' cannot call impure
function 'opCmp'
...\src\phobos\std\math.d(251): Error: safe function 'abs' cannot call system
function 'opCmp'
Line 251 of math.d is:
return x>=0 ? x : -x;
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list