C#Float vs. VB.net Single-Namin的抱怨 [英] C# Float vs. VB.net Single - Namin' complainin'

查看:88
本文介绍了C#Float vs. VB.net Single-Namin的抱怨的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在VB.net中将其称为单身?我敢肯定有一个很好的理由,但是对于像我这样未经正规培训的程序员来说,这似乎并不直观.

Why is it called a single in VB.net? I'm sure there is a good reason but it doesn't seem intuitive to a non formally trained programmer like me.

推荐答案

BPAndrew的问题似乎真的是为什么在C#中浮动而在VB.NET中为Single",却没有人回答,所以这是我的2p ...

BPAndrew's question seems to be really "why float in C# and Single in VB.NET", which noone actually answered, so here's my 2p...

在C#中使用浮点"似乎是对其C/C ++传统的一种回溯. "float"仍然映射到C#中的System.Single类型,因此为方便起见,只存在关键字.您可以像在VB.NET中一样在C#中将变量声明为单".

The use of "float" in C# seems to be a throwback to its C/C++ heritage. "float" still maps to the System.Single type in C#, so the keyword just exists for convenience. You could just as well declare the variable as "Single" in C# the same as you do in VB.NET.

(而且如上所述,将它们命名为Single/Double实际上更有意义,因为它们是Single/double精度浮点数.)

(And as stated above, naming them Single/Double actually makes more sense as they are single/double precision floating-point numbers.)

这篇关于C#Float vs. VB.net Single-Namin的抱怨的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆