Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-hexfloat

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-hexfloat - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

6

hexfloat.js
/*
* $Id: hexfloat.js,v 0.1 2016/01/04 11:51:21 dankogai Exp dankogai $
* $Id: hexfloat.js,v 0.3 2016/01/04 17:53:08 dankogai Exp dankogai $
*

@@ -13,4 +13,4 @@ * Licensed under the MIT license.

var RE_HEXFLOAT =
/([\+\-]?)0x([0-9A-F]+).?([0-9A-F]*)p([\+\-]?[0-9]*)/i;
// 1 2 3 4
/([\+\-]?)0x([0-9A-F]+)\.?([0-9A-F]*)p([\+\-]?[0-9]*)/i;
// 1 2 3 4
var parseHexFloat = function(s) {

@@ -17,0 +17,0 @@ var m = RE_HEXFLOAT.exec(s);

{
"name": "js-hexfloat",
"version": "0.3.0",
"description": "Rudimentary C99 Hexadecimal Float Support in JS",
"version": "0.3.1",
"description": "Rudimentary C99 Hexadecimal Floating Point Support in JS",
"main": "hexfloat.js",

@@ -6,0 +6,0 @@ "directories": {

@@ -5,3 +5,3 @@ [![build status](https://secure.travis-ci.org/dankogai/js-hexfloat.png)](http://travis-ci.org/dankogai/js-hexfloat)

Rudimentary C99 Hexadecimal Float Support in JS
Rudimentary C99 Hexadecimal Floating Point Support in JS

@@ -33,3 +33,3 @@ ## SYNOPSIS

````javascript
/([\+\-]?)0x([0-9A-F]+).?([0-9A-F]*)p([\+\-]?[0-9]*)/i
/([\+\-]?)0x([0-9A-F]+)\.?([0-9A-F]*)p([\+\-]?[0-9]*)/i
````

@@ -36,0 +36,0 @@

/*
* $Id: test.js,v 0.1 2016/01/04 11:51:34 dankogai Exp dankogai $
* $Id: test.js,v 0.2 2016/01/04 17:52:54 dankogai Exp dankogai $
*

@@ -44,2 +44,10 @@ * use mocha to test me

is(isNaN(parseHexFloat('nonsense')), true));
it('0x1p-1074 == Number.MIN_VALUE',
is(parseHexFloat('0x1p-1074'), Number.MIN_VALUE));
it('Number.MIN_VALUE.toHexString()',
is(Number.MIN_VALUE.toHexString(), '0x1p-1074'));
it('0x1.fffffffffffffp+1023 == Number.MAX_VALUE',
is(parseHexFloat('0x1.fffffffffffffp+1023'), Number.MAX_VALUE));
it('Number.MAX_VALUE.toHexString()',
is(Number.MAX_VALUE.toHexString(), '0x1.fffffffffffffp+1023'));
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc