Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Jen asked in Computers & InternetSoftware · 7 years ago

Why do we use floating-point numbers in C#? I don't understand their usage. Please see example below.?

public static BankAccount openBankAccount(string owner, double balance)

{

return openBankAccount(owner, balance, 0.0);

}

public static BankAccount openBankAccount(string owner)

{

return openBankAccount(owner, 0.0);

}

Update:

What does 0.0 stand for? What does it represent?

Update 2:

Like owner is owner, balance is balance, but 0.0 has nothing in "public static BankAccount openBankAccount" defining it.

1 Answer

Relevance
  • Anonymous
    7 years ago

    Your question makes no sense. Are you asking why it's 0.0 and not just 0?

    0 is a decimal number

    0.0 is a floating point number (double precision I believe). it stands for zero.

    oops, didn't see you had the function there. I am confused why there are two unctions called openBankAccount, why they both call openBankAccount. is there a third openBankAccount that takes three arguments?

    you don't seem to know how methods / functions work. You are passing in 0.0, that becomes balance in openBankAccount.

Still have questions? Get your answers by asking now.