mirror of
https://github.com/ziglang/zig.git
synced 2026-02-16 14:28:57 +00:00
Revert 83bdbb2 and a587dd0 (#10028)
This commit is contained in:
parent
a587dd08f8
commit
df167af0b6
@ -18,14 +18,11 @@ const debug_safety = false;
|
||||
/// Returns the number of limbs needed to store `scalar`, which must be a
|
||||
/// primitive integer value.
|
||||
pub fn calcLimbLen(scalar: anytype) usize {
|
||||
const T = @TypeOf(scalar);
|
||||
const max_scalar = switch (@typeInfo(T)) {
|
||||
.Int => maxInt(T),
|
||||
.ComptimeInt => scalar,
|
||||
else => @compileError("parameter must be a primitive integer type"),
|
||||
};
|
||||
if (scalar == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const w_value = std.math.absCast(max_scalar);
|
||||
const w_value = std.math.absCast(scalar);
|
||||
return @divFloor(@intCast(Limb, math.log2(w_value)), limb_bits) + 1;
|
||||
}
|
||||
|
||||
|
||||
@ -4,8 +4,6 @@ const math = std.math;
|
||||
const mem = std.mem;
|
||||
const testing = std.testing;
|
||||
const Allocator = mem.Allocator;
|
||||
const builtin = @import("builtin");
|
||||
const native_arch = builtin.target.cpu.arch;
|
||||
|
||||
const Limb = std.math.big.Limb;
|
||||
const DoubleLimb = std.math.big.DoubleLimb;
|
||||
@ -539,9 +537,6 @@ test "big.rational set" {
|
||||
}
|
||||
|
||||
test "big.rational setFloat" {
|
||||
// TODO https://github.com/ziglang/zig/issues/10026
|
||||
if (native_arch == .wasm32) return error.SkipZigTest;
|
||||
|
||||
var a = try Rational.init(testing.allocator);
|
||||
defer a.deinit();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user