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 9278535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:24:02+00:00 2026-06-18T17:24:02+00:00

When I subclass the integer64 object from bit64 and then perform a equality test,

  • 0

When I subclass the integer64 object from bit64 and then perform a equality test, the result contains logical data, but is still classed with my class rather than being logical. This doesn’t happen with integer for example.

Sample code:

library(bit64)
x = as.integer64(5)
class(x) = c("Foo", "integer64")
x == 5

returns

[1] TRUE
attr(,"class")
[1] "Foo"

Notice that it still has class “Foo”

While if we do the same with integer:

y = as.integer(5)
class(y) = c("Foo", "integer")
y == 5

It returns logical

[1] TRUE

Any idea why is this happening?

  • 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-06-18T17:24:03+00:00Added an answer on June 18, 2026 at 5:24 pm

    Look at the implementation of equals for integer64 variables.

    `==.integer64`
    function (e1, e2) 
    {
        a <- binattr(e1, e2)
        e1 <- as.integer64(e1)
        e2 <- as.integer64(e2)
        ret <- logical(max(length(e1), length(e2)))
        .Call("EQ_integer64", e1, e2, ret)
        a$class <- minusclass(a$class, "integer64")
        setattributes(ret, a)
        ret
    }
    

    The return value is explicitly given a class attribute equal to the class of a, minus the class "integer64".

    binattr, that creates the variable a is a rather odd function that checks that the two inputs are of a compatible size, then returns the attributes of one or the other, depending upon which ones have a dim attribute.

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

Sidebar

Related Questions

Is it possible to subclass dynamically? I know there's ____bases____ but I don't want
I have a method to generate a Deck object (NSObject subclass with an NSMutableArray
I'm trying to subclass an unmanaged statusbar window from my managed COM server using
I am working with a Python object that implements __add__ , but does not
In Qt, what is the most elegant way to pass data from a QDialog
So I understand you aren't supposed to to directly subclass Fixnum, Float or Integer,
If subclass in objective-c wants to override a super class's method, does it have
I have a UITableViewCell subclass which draws a rectangular vertical line of 5px width
I have a subclass of UIScrollView that I have set as the view of
Here is the UIPanGesture subclass: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@touches began); self

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.