Skip to content

Commit 747ab34

Browse files
committed
update docs and CBORTest.java
1 parent 2e5b280 commit 747ab34

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Written by Peter O. in 2013-2014. In the public domain.
22

3-
Public domain dedication: http://creativecommons.org/publicdomain/zero/1.0/
3+
Public domain dedication: [http://creativecommons.org/publicdomain/zero/1.0/](http://creativecommons.org/publicdomain/zero/1.0/)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CBOR
22
====
33

4-
If you like this software, consider donating to me at this link: http://upokecenter.dreamhosters.com/articles/donate-now-2/
4+
If you like this software, consider donating to me at this link: [http://upokecenter.dreamhosters.com/articles/donate-now-2/](http://upokecenter.dreamhosters.com/articles/donate-now-2/)
55

66
----
77

@@ -91,10 +91,10 @@ About
9191
Written in 2013-2014 by Peter O.
9292

9393
Any copyright is dedicated to the Public Domain.
94-
http://creativecommons.org/publicdomain/zero/1.0/
94+
[http://creativecommons.org/publicdomain/zero/1.0/](http://creativecommons.org/publicdomain/zero/1.0/)
9595

9696
If you like this, you should donate to Peter O.
97-
at: http://peteroupc.github.io/CBOR/
97+
at: [http://peteroupc.github.io/CBOR/](http://peteroupc.github.io/CBOR/)
9898

9999
Clarifications
100100
------------------

src/test/java/com/upokecenter/test/CBORTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,6 +1964,22 @@ public void TestCBORFromArray() {
19641964
TestCommon.AssertRoundTrip(o);
19651965
}
19661966

1967+
@Test
1968+
public void TestHalfPrecision() {
1969+
CBORObject o = CBORObject.DecodeFromBytes(
1970+
new byte[] { (byte)0xf9, 0x7c, 0x00 });
1971+
Assert.assertEquals(Float.POSITIVE_INFINITY, o.AsSingle());
1972+
o = CBORObject.DecodeFromBytes(
1973+
new byte[] { (byte)0xf9, 0x00, 0x00 });
1974+
Assert.assertEquals(Float.POSITIVE_INFINITY, o.AsSingle());
1975+
o = CBORObject.DecodeFromBytes(
1976+
new byte[] { (byte)0xf9, (byte)0xfc, 0x00 });
1977+
Assert.assertEquals(Float.NEGATIVE_INFINITY, o.AsSingle());
1978+
o = CBORObject.DecodeFromBytes(
1979+
new byte[] { (byte)0xf9, 0x7e, 0x00 });
1980+
if (!(Float.isNaN(o.AsSingle())))Assert.fail();
1981+
}
1982+
19671983
@Test
19681984
public void TestJSON() {
19691985
CBORObject o;

0 commit comments

Comments
 (0)