what is 2+2

6 次查看(过去 30 天)
Abdullah
Abdullah 2025-1-24
编辑: Parag 2025-2-18
what is 2+2

回答(2 个)

Walter Roberson
Walter Roberson 2025-1-24
2 + 2
ans = 4
double(2) + double(2)
ans = 4
single(2) + single(2)
ans = single 4
sym(2) + sym(2)
ans = 
4
uint8(2) + uint8(2)
ans = uint8 4
int8(2) + int8(2)
ans = int8 4
uint16(2) + uint16(2)
ans = uint16 4
int16(2) + int16(2)
ans = int16 4
uint32(2) + uint32(2)
ans = uint32 4
int32(2) + int32(2)
ans = int32 4
uint64(2) + uint64(2)
ans = uint64 4
int64(2) + int64(2)
ans = int64 4

Parag
Parag 2025-1-27
编辑:Parag 2025-2-18
Hi @Walter Roberson you skipped one case :)
string(2) + string(2)
ans = "22"

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by