mfbt/FloatingPoint.cpp
author Jonathan Kew <jkew@mozilla.com>
Tue, 12 Nov 2013 09:10:34 +0000
changeset 169365 f8a78d1723d86d83530ad05b32d008772143fa44
parent 165497 9d216ff3bbe644cfbf69444e0633a1245267d7dc
child 210314 cf068fd95d3cef2e75205ae37c937bfaee01506f
permissions -rw-r--r--
bug 909344 - reftest for display of stray control characters. r=roc

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Implementations of FloatingPoint functions */

#include "mozilla/FloatingPoint.h"

namespace mozilla {

bool
IsFloat32Representable(double x)
{
    float asFloat = static_cast<float>(x);
    double floatAsDouble = static_cast<double>(asFloat);
    return floatAsDouble == x;
}

} /* namespace mozilla */