Skip to content

math: floating point epsilon constant #966

@rsc

Description

@rsc
---------- Forwarded message ----------
From: Sanbo Qin <qsb300@gmail.com>
Date: Mon, Jul 26, 2010 at 13:29
Subject: [go-nuts] Where is the similar of FLT_EPSILON / DBL_EPSILON in go
To: golang-nuts <golang-nuts@googlegroups.com>


I can't find it. I think it is a very useful constant in float
comparison, which is defined in <float.h> in C.
I find some relative constant, such as MaxFloat32, MaxFloat64, MaxInt8
in pkg/math/const.go. But I can't find EPSILON that defined the
smallest number x such that 1.0 + x != 1.0.
Is it good to add it into the go? How about to add it into pkg/math/const.go?
Or if I just miss it, where is it?
Thanks.
Sanbo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions