专栏名称: GO语言(微博搜索)
目录
相关文章推荐
Linux就该这么学  ·  不止是操作系统!Linux ... ·  昨天  
Linux就该这么学  ·  官宣:这所高校禁用 DeepSeek ·  2 天前  
Linux就该这么学  ·  Fedora即将登陆Win10/11 ... ·  3 天前  
Linux就该这么学  ·  微信新功能升级:可一次性删除所有“单向好友” ·  3 天前  
51好读  ›  专栏  ›  GO语言(微博搜索)

GO语言(微博搜索)-20230109-1

GO语言(微博搜索)  · 微博搜索  ·  · 2023-01-09 00:00

正文

本条微博地址 福大大架构师每日一题
2023-01-09:以下go语言代码输出什么?A:+ 2023-01-09:以下go语言代码输出什么?A:+Inf; B:zero; C:something else; D:doesn't compile。
package main

import (
"fmt"
"math"
)

func main() {
// Inf returns positive infinity if sign >= 0, negative infinity if sign < 0.
x := math.Inf(1)
switch {
case x < 0, x > 0:
fmt.Println(x)
case x == 0:
fmt.Println("zero")
default:
fmt.Println("something else")
}
}
#福大大架构师每日一题# 绿洲






请到「今天看啥」查看全文