Browse Source

change package name and directory structure

speter 13 years ago
parent
commit
0c8464876b
6 changed files with 17 additions and 17 deletions
  1. 1 1
      benchmark_test.go
  2. 1 1
      dec.go
  3. 1 1
      dec_test.go
  4. 12 12
      example_test.go
  5. 1 1
      rounder.go
  6. 1 1
      rounder_test.go

+ 1 - 1
dec/benchmark_test.go → benchmark_test.go

@@ -1,4 +1,4 @@
-package dec
+package inf
 
 
 import (
 import (
 	"fmt"
 	"fmt"

+ 1 - 1
dec/dec.go → dec.go

@@ -15,7 +15,7 @@
 // Quotient (division) operation uses Scalers and Rounders to specify the
 // Quotient (division) operation uses Scalers and Rounders to specify the
 // desired behavior. See Quo, Scaler, and Rounder for details.
 // desired behavior. See Quo, Scaler, and Rounder for details.
 //
 //
-package dec
+package inf
 
 
 // This file implements signed multi-precision decimals.
 // This file implements signed multi-precision decimals.
 
 

+ 1 - 1
dec/dec_test.go → dec_test.go

@@ -1,4 +1,4 @@
-package dec
+package inf
 
 
 import (
 import (
 	"bytes"
 	"bytes"

+ 12 - 12
dec/example_test.go → example_test.go

@@ -1,14 +1,14 @@
-package dec_test
+package inf_test
 
 
 import (
 import (
 	"fmt"
 	"fmt"
 	"log"
 	"log"
 )
 )
 
 
-import "code.google.com/p/godec/dec"
+import "speter.net/go/exp/math/dec/inf"
 
 
 func ExampleDec_SetString() {
 func ExampleDec_SetString() {
-	d := new(dec.Dec)
+	d := new(inf.Dec)
 	d.SetString("012345.67890") // decimal; leading 0 ignored; trailing 0 kept
 	d.SetString("012345.67890") // decimal; leading 0 ignored; trailing 0 kept
 	fmt.Println(d)
 	fmt.Println(d)
 	// Output: 12345.67890
 	// Output: 12345.67890
@@ -17,7 +17,7 @@ func ExampleDec_SetString() {
 func ExampleDec_Scan() {
 func ExampleDec_Scan() {
 	// The Scan function is rarely used directly;
 	// The Scan function is rarely used directly;
 	// the fmt package recognizes it as an implementation of fmt.Scanner.
 	// the fmt package recognizes it as an implementation of fmt.Scanner.
-	d := new(dec.Dec)
+	d := new(inf.Dec)
 	_, err := fmt.Sscan("184467440.73709551617", d)
 	_, err := fmt.Sscan("184467440.73709551617", d)
 	if err != nil {
 	if err != nil {
 		log.Println("error scanning value:", err)
 		log.Println("error scanning value:", err)
@@ -29,34 +29,34 @@ func ExampleDec_Scan() {
 
 
 func ExampleDec_Quo_scale2RoundDown() {
 func ExampleDec_Quo_scale2RoundDown() {
 	// 10 / 3 is an infinite decimal; it has no exact Dec representation
 	// 10 / 3 is an infinite decimal; it has no exact Dec representation
-	x, y := dec.NewDecInt64(10), dec.NewDecInt64(3)
+	x, y := inf.NewDecInt64(10), inf.NewDecInt64(3)
 	// use 2 digits beyond the decimal point, round towards 0
 	// use 2 digits beyond the decimal point, round towards 0
-	z := new(dec.Dec).Quo(x, y, dec.Scale(2), dec.RoundDown)
+	z := new(inf.Dec).Quo(x, y, inf.Scale(2), inf.RoundDown)
 	fmt.Println(z)
 	fmt.Println(z)
 	// Output: 3.33
 	// Output: 3.33
 }
 }
 
 
 func ExampleDec_Quo_scale2RoundCeil() {
 func ExampleDec_Quo_scale2RoundCeil() {
 	// -42 / 400 is an finite decimal with 3 digits beyond the decimal point
 	// -42 / 400 is an finite decimal with 3 digits beyond the decimal point
-	x, y := dec.NewDecInt64(-42), dec.NewDecInt64(400)
+	x, y := inf.NewDecInt64(-42), inf.NewDecInt64(400)
 	// use 2 digits beyond decimal point, round towards positive infinity
 	// use 2 digits beyond decimal point, round towards positive infinity
-	z := new(dec.Dec).Quo(x, y, dec.Scale(2), dec.RoundCeil)
+	z := new(inf.Dec).Quo(x, y, inf.Scale(2), inf.RoundCeil)
 	fmt.Println(z)
 	fmt.Println(z)
 	// Output: -0.10
 	// Output: -0.10
 }
 }
 
 
 func ExampleDec_QuoExact_ok() {
 func ExampleDec_QuoExact_ok() {
 	// 1 / 25 is a finite decimal; it has exact Dec representation
 	// 1 / 25 is a finite decimal; it has exact Dec representation
-	x, y := dec.NewDecInt64(1), dec.NewDecInt64(25)
-	z := new(dec.Dec).QuoExact(x, y)
+	x, y := inf.NewDecInt64(1), inf.NewDecInt64(25)
+	z := new(inf.Dec).QuoExact(x, y)
 	fmt.Println(z)
 	fmt.Println(z)
 	// Output: 0.04
 	// Output: 0.04
 }
 }
 
 
 func ExampleDec_QuoExact_fail() {
 func ExampleDec_QuoExact_fail() {
 	// 1 / 3 is an infinite decimal; it has no exact Dec representation
 	// 1 / 3 is an infinite decimal; it has no exact Dec representation
-	x, y := dec.NewDecInt64(1), dec.NewDecInt64(3)
-	z := new(dec.Dec).QuoExact(x, y)
+	x, y := inf.NewDecInt64(1), inf.NewDecInt64(3)
+	z := new(inf.Dec).QuoExact(x, y)
 	fmt.Println(z)
 	fmt.Println(z)
 	// Output: <nil>
 	// Output: <nil>
 }
 }

+ 1 - 1
dec/rounder.go → rounder.go

@@ -1,4 +1,4 @@
-package dec
+package inf
 
 
 // This file implements signed multi-precision decimals.
 // This file implements signed multi-precision decimals.
 
 

+ 1 - 1
dec/rounder_test.go → rounder_test.go

@@ -1,4 +1,4 @@
-package dec
+package inf
 
 
 import (
 import (
 	"math/big"
 	"math/big"