Skip to content

Instantly share code, notes, and snippets.

@athom
athom / gist:6008849
Created July 16, 2013 13:48
cube root iterate
package main
import (
"fmt"
"math/cmplx"
"math"
)
func equal(x, y complex128) bool {
delta := 0.0001
@athom
athom / gist:6009124
Created July 16, 2013 14:17
牛顿迭代闭包版
package main
import (
"fmt"
"math"
"math/cmplx"
)
func equal(x, y complex128) bool {
delta := 0.000001
//$('.qor-notify-number').hide(); //红色通知,还是留着吧...
$('.qor-notify-num-grey').hide(); //灰色未读数不要
$('.new-stream-bar').remove(); //不要主动推送消息
func TestSha1(t *testing.T) {
v := map[string]string{"name": "Felix", "age": "18"}
e := &v
//e := &[]string{"hi"}
sh1 := sha1.New()
io.WriteString(sh1, "q3244214")
ge := gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(".........!")