Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7598969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:32:36+00:00 2026-05-30T22:32:36+00:00

Why modulo runs fine with decimal but not with float/real MSDN states about it

  • 0

Why modulo runs fine with decimal but not with float/real
MSDN states about it “must be a valid expression of any one of the data types in the integer and monetary data type categories, or the numeric data type.” why not floating values, because it is an approximate value ??

--Runs fine
declare @pri decimal
set @pri = 3.25
select @pri%2

Result 1

--Gives an error 402
declare @pri float
set @pri = 3.25
select @pri%2

Msg 402, Level 16, State 1, Line 3
The data types float and numeric are incompatible in the modulo operator.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:32:37+00:00Added an answer on May 30, 2026 at 10:32 pm

    If your question about the documentation?

    MSDN documentation

    dividend must be a valid expression of any one of the data types in
    the integer and monetary data type categories, or the numeric data
    type.

    It says integer, monetary (money, smallmoney) and numeric

    So, decimal is not supported. The documentation says “numeric is functionally same as decimal” but may be it has different meaning in some context like this one.

    I guess, float is treated as numeric datatype where as decimal is not

    Read the data types. It has information on monetary data types. (money, smallmoney)

    Update:

    Here is the catagory wise data type list. You can follow the links to numeric and money to find what datatypes falls in it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DotNetNuke Module created in DNN 4.9.2. It runs fine on my
I have a django project which runs just fine with runserver located in: D:\EverTabs\work\evertabs-website\src\evertabs\
The app runs fine using django internal server however when I use apache +
I'm working on an application which builds and runs fine in Win32. However, in
I'm using the Perl module of Statistics::Regression . It runs multi-variate regressions fine. However,
The following code runs fine in my IDE (PyScripter), however it won't run outside
I'm having a problem wherein my Python 2.7.3rc2 code runs fine through an IDE
In a similar way that modulo generates a sawtooth wave. It doesn't have to
How can we implement the modulo operator as a function in C without using
I would like to define some kind of safe division (and modulo) function, one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.