Skip to content

std.math.pow doesn't support f16, f80, f128, c_longdouble or comptime_float #23602

@Empika1

Description

@Empika1

Zig Version

0.14.0

Steps to Reproduce and Observed Behavior

const std = @import("std");
pub fn main() void {
    _ = std.math.pow(f16, 1, 1);
    _ = std.math.pow(f80, 1, 1);
    _ = std.math.pow(f128, 1, 1);
    _ = std.math.pow(c_longdouble, 1, 1);
    _ = std.math.pow(comptime_float, 1, 1);
}
error: pow not implemented for f16
error: pow not implemented for f80
error: pow not implemented for f128
error: pow not implemented for c_longdouble
error: pow not implemented for comptime_float

Expected Behavior

I expected pow to be implemented for all standard floating point types. I'm not sure exactly how the algorithm works, but judging by the fact that it already handles 2 types (f32 and f64) without branching, this doesn't seem like it would be too hard to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions