oarmsch
Goto Top

C sharp basics

servus.
folgendes Problem kann im Visual Studio mit float keine Gleitkommazahlen darstellen.
Erste Dezimalstelle rechts vom punkt wird sofort rot unterstrichen (Ganzzahlen funktionieren)
es kommt ein Fehler mit (Datentyp ist Double zugeordnet).

bitte um Lösungsvorschläge.

Content-Key: 499997

Url: https://administrator.de/contentid/499997

Printed on: May 6, 2024 at 18:05 o'clock

Mitglied: 141320
141320 Sep 30, 2019 updated at 14:33:33 (UTC)
Goto Top
Moin,
Näääää ne
float f = 10.2F;
Float: It is 32-bit single-precision floating point type. It has 7 digit Precision. To initialize a float variable, use the suffix f or F. Like, float x = 3.5F;. If the suffix F or f will not use then it is treated as double.
https://www.geeksforgeeks.org/c-sharp-data-types/

bitte um Lösungsvorschläge.
Nächstes mal erst mal bitte Google würgen, oder den Text in der Fehlermeldung lesen ...

screenshot


Gruß