7 Replies - 9538 Views - Last Post: 02 August 2013 - 06:10 AM

#1 ybadragon  Icon User is offline

  • Home Owner
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,647
  • Joined: 11-May 12

What does "!" do?

Posted 01 August 2013 - 08:08 PM

I was messing with some code today (big surprise right? :whistling:/> ) and I was trying to assign a variable to a Factorial 5! to be specific What I did was

Dim i as Integer = 5!



This didn't throw an error, but it also didn't give me the result I expected. when I hit enter after the "!" it changed 5! to 5.0!

I eventually created a recursive function to find the factorial of a number, but my question is simply what does "!" do in VB.Net? I searched google and couldn't find anything, I don't know if I was using the wrong search terms or what, but if anyone knows the answer I'd appreciate some insight :)

This post has been edited by ybadragon: 01 August 2013 - 08:11 PM


Is This A Good Question/Topic? 1
  • +

Replies To: What does "!" do?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,481
  • Joined: 12-June 08

Re: What does "!" do?

Posted 01 August 2013 - 08:10 PM

Missing code?
Was This Post Helpful? 0
  • +
  • -

#3 ybadragon  Icon User is offline

  • Home Owner
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,647
  • Joined: 11-May 12

Re: What does "!" do?

Posted 01 August 2013 - 08:15 PM

I fixed the code all that is stored in i is 5! which becomes 5 for some reason. sorry my finger slipped and I hit enter...it's late here :P
Was This Post Helpful? 0
  • +
  • -

#4 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5061
  • View blog
  • Posts: 13,657
  • Joined: 18-April 07

Re: What does "!" do?

Posted 01 August 2013 - 08:17 PM

The exclamation point is an Identifier type character for Single. Read more about it here...

http://msdn.microsof...(v=vs.110).aspx

I assume this is what you mean. :)

This post has been edited by Martyr2: 01 August 2013 - 08:18 PM

Was This Post Helpful? 1
  • +
  • -

#5 ybadragon  Icon User is offline

  • Home Owner
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,647
  • Joined: 11-May 12

Re: What does "!" do?

Posted 01 August 2013 - 08:19 PM

oooooh ok, that is definitely what I was looking for. I was searching for arithmetic operators, which would explain why I couldn't figure it out :rolleyes2:

Thanks! :D
Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: What does "!" do?

Posted 02 August 2013 - 05:47 AM

It is also the Dictionary Lookup Operator.
Was This Post Helpful? 1
  • +
  • -

#7 andrewsw  Icon User is online

  • lashings of ginger beer
  • member icon

Reputation: 6340
  • View blog
  • Posts: 25,573
  • Joined: 12-December 12

Re: What does "!" do?

Posted 02 August 2013 - 06:01 AM

View PostAdamSpeight2008, on 02 August 2013 - 12:47 PM, said:


also called the bang operator
Added: or pling, apparently.

This post has been edited by andrewsw: 02 August 2013 - 06:06 AM

Was This Post Helpful? 0
  • +
  • -

#8 ybadragon  Icon User is offline

  • Home Owner
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,647
  • Joined: 11-May 12

Re: What does "!" do?

Posted 02 August 2013 - 06:10 AM

I like the idea of the Dictionary Lookup Operator. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1