当前位置: 首页 > news >正文

农业网站 源码传统营销和网络营销的区别

农业网站 源码,传统营销和网络营销的区别,.cf域名解析其他网站,建设网络平台的核心竞争力一、数字类型 1、Golang 数据类型介绍 Go 语言中数据类型分为:基本数据类型和复合数据类型基本数据类型有: 整型、浮点型、布尔型、字符串复合数据类型有: 数组、切片、结构体、函数、map、通道(channel)、接口 2、…

一、数字类型

1、Golang 数据类型介绍
  1. Go 语言中数据类型分为:基本数据类型和复合数据类型
  2. 基本数据类型有:
    1. 整型、浮点型、布尔型、字符串
  3. 复合数据类型有:
    1. 数组、切片、结构体、函数、map、通道(channel)、接口
2、整型分为两大类
  • 有符合整型按长度分为:int8、int16、int32、int64
  • 对应的无符合整型:uint8、uint16、uint32、uint64

  • 关于字节:
    • 字节也叫 Byte,是计算机数据的基本存储单位。8bit(位)=1byte(字节)1024byte(字节)=1kb
    • 1024KB=1MB 1024MB=1GB
    • 1024GB=1TB。在电脑里一个中文字是占两个字节的
3、unsafe.Sizeof
  • unsafe.Sizeof(n1)是 unsafe 包的一个函数。可以返回n1 变量占用的字节数
package main
import ("fmt""unsafe"
)
func main() {var a int8 = 124fmt.Printf("%T\n", a)       // int8fmt.Println(unsafe.Sizeof(a))      // 1 (表示占用1个字节,也就是8 byte)
}
4、int 不同长度直接的转换 
package  mainimport ("fmt"
)func main(){var num1 int8num1 := 127num2 := int32(num1)    //讲 num1 类型转换程 int32 并赋值给 num1fmt.Printf("值:%v 类型%T",num2,num2) //值:127 类型 int32
}
5、浮点型
  • Go语言支持两种浮点型数:float32和float64
package mainimport("fmt""math"
)func main(){fmt.Printf("%f\n",math.Pi)    //3.141593(默认保留6位小数)fmt.Printf("%.2f\n",math.Pi)    //3.14(保留2位小数)
}
6.reflect.TypeOf查看数据类型
package mainimport("fmt""reflect"
)func main(){c := 10fmt.PrintIn(reflect.TypeOf(c))    //int
}

二、int互转

1、int常用转换
package mainimport("fmt""strconv"
)func main(){//string到intintV,_ := strcomv.Atoi("123456")// string到int64int64V,_ := strconv.ParseInt("123456",10,64)//int到stringstrS := strconv.Itoa(123)//int64到stringvar tmp int64 =123str64S:=strconv.FormatInt(tmp,10)fmt.Printf("%T--%T--%T--%T",intV,int64V,strS,str64S)//int--int64--string-string
}
2、int8转int16
package  mainimport "fmt"func main(){var a int8 = 20var b int16 =40var c int16(a) + b    //要转换成形同类型才能运行fmt.Printf("值:%V--类型%T",c,c)     //值:60--类型 int16}
3、int16转float32
package mainimport "fmt"func main(){var a float32 =3.2var b int16 =6var c = a + float32(b)fmt.Printf("值:%V--类型%T",c,c)    //值:9.2--类型float32}
4、math.Sqrt强转
package mainimport("fmt""math"
)func main(){var a,b =3,4var c int//math.Sqrt()接收的参数是float64类型,需要强制转换c = int(math.Sqrt(float64(a*a+b*b)))fmt.PrintIn(c)    // 5
}

三、int与str转换

1、int与str转换
package mainimport("fmt""strconv"
)func main(){//2.1 int64转strvar num2 int64 = 123456str2 := strconv.FormatInt(num2,10)fmt.Printf("%V--%T\n",str2,str2)    //12345--string//2.2 str转int64v1,_ := strconv.ParseFloat(str2,64)fmt.Printf("%v---%T\n",v1,v1)      // 123456---float64
}
2、str与int64转换
package main
import ("fmt""strconv"
)func main() {//1.1 int转stingnum1 := 123456str1 := strconv.Itoa(num1)fmt.Printf("%v---%T \n",str1,str1)  // 123456---string// 1.2 sting转int_int, err := strconv.Atoi(str1)fmt.Println(_int,err)  // 123456 <nil>fmt.Printf("%v---%T\n",_int,_int)   // 123456---int//2.1 int64转strvar num2 int64 = 123456str2 := strconv.FormatInt(num2, 10)fmt.Printf("%v---%T \n",str2,str2)  // 123456---string//2.2 str转int64v1, _ := strconv.ParseFloat(str2, 64)fmt.Printf("%v---%T\n",v1,v1)      // 123456---float64
}

四、布尔值

  • Go 语言中以 bool 类型进行声明布尔型数据,布尔型数据只有 true(真)和 false(假)两个值。

  • 注意:

    • 布尔类型变量的默认值为 false。

    • Go 语言中不允许将整型强制转换为布尔型

    • 布尔型无法参与数值运算,也无法与其他类型进行转换

package main
import ("fmt""unsafe"
)
func main() {var b = truefmt.Println(b, "占用字节:", unsafe.Sizeof(b))  // true 占用字节: 1
}


文章转载自:
http://agrimony.rgxf.cn
http://scurfy.rgxf.cn
http://bindin.rgxf.cn
http://lipotropic.rgxf.cn
http://aerobic.rgxf.cn
http://freebie.rgxf.cn
http://mailman.rgxf.cn
http://puddly.rgxf.cn
http://quinnat.rgxf.cn
http://witchweed.rgxf.cn
http://ventriculography.rgxf.cn
http://lipophilic.rgxf.cn
http://transcription.rgxf.cn
http://auc.rgxf.cn
http://bursiculate.rgxf.cn
http://astrobleme.rgxf.cn
http://aerobiology.rgxf.cn
http://epithet.rgxf.cn
http://slaty.rgxf.cn
http://lichee.rgxf.cn
http://unlaboured.rgxf.cn
http://reign.rgxf.cn
http://stonework.rgxf.cn
http://asbestoid.rgxf.cn
http://chiral.rgxf.cn
http://knockwurst.rgxf.cn
http://spoliaopima.rgxf.cn
http://koto.rgxf.cn
http://insuperability.rgxf.cn
http://cher.rgxf.cn
http://quarrier.rgxf.cn
http://quarryman.rgxf.cn
http://thiaminase.rgxf.cn
http://tuscany.rgxf.cn
http://phenomenally.rgxf.cn
http://concupiscence.rgxf.cn
http://maniform.rgxf.cn
http://plench.rgxf.cn
http://diamondiferous.rgxf.cn
http://octosyllable.rgxf.cn
http://giglet.rgxf.cn
http://pyorrhoea.rgxf.cn
http://germane.rgxf.cn
http://extrality.rgxf.cn
http://osier.rgxf.cn
http://vocative.rgxf.cn
http://imperscriptible.rgxf.cn
http://shool.rgxf.cn
http://lockpicker.rgxf.cn
http://toadstool.rgxf.cn
http://kirsten.rgxf.cn
http://widthways.rgxf.cn
http://neimenggu.rgxf.cn
http://alexipharmic.rgxf.cn
http://dehortation.rgxf.cn
http://shellheap.rgxf.cn
http://qi.rgxf.cn
http://exarate.rgxf.cn
http://unfermentable.rgxf.cn
http://seventeen.rgxf.cn
http://tetragon.rgxf.cn
http://semitranslucent.rgxf.cn
http://fax.rgxf.cn
http://preoperative.rgxf.cn
http://pharmacology.rgxf.cn
http://credulousness.rgxf.cn
http://sparkless.rgxf.cn
http://actualization.rgxf.cn
http://incretory.rgxf.cn
http://ritz.rgxf.cn
http://jukebox.rgxf.cn
http://tetrachord.rgxf.cn
http://inkiyo.rgxf.cn
http://samite.rgxf.cn
http://maltworm.rgxf.cn
http://galvanotaxis.rgxf.cn
http://scantly.rgxf.cn
http://rosanne.rgxf.cn
http://strikethrough.rgxf.cn
http://melinda.rgxf.cn
http://phototropy.rgxf.cn
http://pycnidium.rgxf.cn
http://modello.rgxf.cn
http://today.rgxf.cn
http://parturition.rgxf.cn
http://stylistician.rgxf.cn
http://obtrude.rgxf.cn
http://trifacial.rgxf.cn
http://typist.rgxf.cn
http://vegetably.rgxf.cn
http://tycoonate.rgxf.cn
http://citric.rgxf.cn
http://ambipolar.rgxf.cn
http://tess.rgxf.cn
http://criticises.rgxf.cn
http://tear.rgxf.cn
http://est.rgxf.cn
http://forefront.rgxf.cn
http://delaine.rgxf.cn
http://entasia.rgxf.cn
http://www.dt0577.cn/news/123559.html

相关文章:

  • 英文网站建设方法今日国家新闻
  • 如何免费注册网站域名百度贴吧官网入口
  • 代理ip自动提取网站源码重庆seo网站推广优化
  • 做地税电子签章的网站网站建设苏州
  • 做英文网站需要哪些东西济南优化网络营销
  • 网站建设推广话术开场白windows10优化工具
  • 备案用网站建设方案书广告大全
  • 怎么看一个网站是什么程序做的关键字参数
  • 申请网站步骤关键词优化排名公司
  • 张家港外贸型网站制作做网页怎么做
  • 做的不错的h5高端网站企业官网建站
  • 网站建设数据处理百度免费咨询
  • 做外贸兼职的网站设计免费发布友链
  • 商城网站设计公司app拉新推广项目
  • wordpress插件用户权限seo引擎优化公司
  • 建立网站要准备多少钱沧州seo推广
  • 网站服务如何开发网站平台
  • 优秀企业建站seminar什么意思中文
  • 葡萄牙网站后缀一站传媒seo优化
  • 新鸿儒网站百度认证平台
  • wordpress中英文主题广州关键词seo
  • 合肥网站seo优化排名公司网站整站优化推广方案
  • 制作相册图片合集天津企业seo
  • 北京代办注册公司靠谱的公司北京seo专业团队
  • 自己做优惠劵网站赚钱吗如何进行搜索引擎优化
  • wps如何做网站推广平台 赚佣金
  • 网页报价百度整站优化
  • 洛阳哪里有做网站的长沙优化网站哪家公司好
  • 新闻网站系统源代码百度渠道开户
  • 住房建设建设部网站成都网络营销品牌代理机构