answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
antiseptic1488 [7]
2 years ago
8

Float_abs - return bit-level equivalent of absolute value of f for * floating point argument f. * both the argument and result a

re passed as unsigned int's, but * they are to be interpreted as the bit-level representations of * single-precision floating point values. * when argument is nan, return argument.. * legal ops: any integer/unsigned operations incl. ||, &&. also if, while * max ops: 10 * rating: 2
Computers and Technology
1 answer:
olga_2 [115]2 years ago
3 0

#include <stdio.h>

int main(void) {

            // your code goes here

            //unsigned a =float_times_four(0x80000000);

            unsigned float_times_four(unsigned uf){

                unsigned expn = (uf >> 23) & 0xFF;

                printf(expn);

                unsigned sign = uf & 0x80000000;

                unsigned frac = uf & 0x007FFFFF;

                if(expn == 255 ||(expn == 0 && frac ==0))

                    return uf;

                if(expn){

                    expn<<2;

                }else if(frac == 0x007FFFFF){

//here 0x7FFFFF given by you that is wrong you place this 0x007FFFFF will excute

                    frac>>2;

                    expn<<2;

                }else{

                    frac<<=2;

                }

return (sign) | (expn <<23) | (frac);

            }

            return 0;

}

You might be interested in
Locker doors There are n lockers in a hallway, numbered sequentially from 1 to n. Initially, all the locker doors are closed. Yo
kow [346]

Answer:

// here is code in C++

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int n,no_open=0;

   cout<<"enter the number of lockers:";

   // read the number of lockers

   cin>>n;

   // initialize all lockers with 0, 0 for locked and 1 for open

   int lock[n]={};

   // toggle the locks

   // in each pass toggle every ith lock

   // if open close it and vice versa

   for(int i=1;i<=n;i++)

   {

       for(int a=0;a<n;a++)

       {

           if((a+1)%i==0)

           {

               if(lock[a]==0)

               lock[a]=1;

               else if(lock[a]==1)

               lock[a]=0;

           }

       }

   }

   cout<<"After last pass status of all locks:"<<endl;

   // print the status of all locks

   for(int x=0;x<n;x++)

   {

       if(lock[x]==0)

       {

           cout<<"lock "<<x+1<<" is close."<<endl;

       }

       else if(lock[x]==1)

       {

           cout<<"lock "<<x+1<<" is open."<<endl;

           // count the open locks

           no_open++;

       }

   }

   // print the open locks

   cout<<"total open locks are :"<<no_open<<endl;

return 0;

}

Explanation:

First read the number of lockers from user.Create an array of size n, and make all the locks closed.Then run a for loop to toggle locks.In pass i, toggle every ith lock.If lock is open then close it and vice versa.After the last pass print the status of each lock and print count of open locks.

Output:

enter the number of lockers:9

After last pass status of all locks:

lock 1 is open.

lock 2 is close.

lock 3 is close.

lock 4 is open.

lock 5 is close.

lock 6 is close.

lock 7 is close.

lock 8 is close.

lock 9 is open.

total open locks are :3

5 0
2 years ago
You have enabled IPv6 on two of your routers, but on the interfaces you have not assigned IPv6 addresses yet. You are surprised
babymother [125]

Answer:

You have enabled IPv6 on two of your routers, but on the interfaces you have not assigned IPv6 addresses yet. You are surprised to learn that these two machines are exchanging information over those interfaces. How is this possible?

a. Due to anycast addressing

b. Due to ICMPv6

c. Due to the NATv6 capability

d. Due to the link-local IPv6 addresses

The correct answer is D. Due to the link-local addresses

Explanation:

LINK-LOCAL ADDRESS

Link-local addresses are addresses that can be used for unicast communications on a confined LAN segment.  The requirement with these addresses is that they are only locally-significant (i.e., restricted to a single LAN broadcast domain) and are never used to source or receive communications across a layer-3 gateway.

Typically, link-local IPv6 addresses have “FE80” as the hexadecimal representation of the first 10 bits of the 128-bit IPv6 address, then the least-significant 64-bits of the address are the Interface Identifier (IID).  Depending on the IID algorithm the node’s operating system is using, the IID may use either modified EUI-64 with SLAAC, the privacy addressing method (RFC 4941)), or the newly published Stable SLAAC IID method(RFC 8064).

When a host boots up, it automatically assigns an FE80::/10 IPv6 address to its interface.  You can see the format of the link-local address below. It starts with FE80 and is followed by 54 bits of zeros. Lastly, the final 64-bits provide the unique Interface Identifier.

FE80:0000:0000:0000:abcd:abcd:abcd:abcd

Link-local IPv6 addresses are present on every interface of IPv6-enabled host and router.  They are vital for LAN-based Neighbor Discovery communication.  After the host has gone through the Duplicate Address Detection (DAD) process ensuring that its link-local address (and associated IID) is unique on the LAN segment, it then proceeds to sending an ICMPv6 Router Solicitation (RS) message sourced from that address.

IPv6 nodes send NS messages so that the link-layer address of a specific neighbor can be found. There are three operations in which this message is used:

▪   For detecting duplicate address

▪   Verification of neighbor reachability

▪   Layer 3 to Layer 2 address resolution (for ARP replacement)  ARP is not included in IPv6 as a protocol but rather the same functionality is integrated into ICMP as part of neighbor discovery. NA message is the response to an NS message.  From the figure the enabling of interaction or communication between neighbor discoveries between two IPv6 hosts can be clearly seen.

3 0
2 years ago
Which among the following enhances WS-Security to facilitate a mechanism for issuing, renewing, and validating security tokens?
Aleksandr-060686 [28]

Answer:

a. WS-Trust

Explanation:

WS-Trust can be defined as a WS-specification as well as OASIS standard that help to provides extensions to WS-Security, in order to facilitate a mechanism for issuing, renewing, as well as validating of security tokens which is why the aim and objectives of WS-Trust is to help and enable applications to construct trusted SOAP message exchanges.

Nevertheless WS-Trust enables the issuance as well as the dissemination of credentials within several and various trust domains.

5 0
1 year ago
5.16 *zyLab: Hello IDE The goal of this problem is learn how to use Eclipse or IntelliJ. Submit the source code files (.java) be
givi [52]

Answer:

import java.util.Scanner;

public class HelloIDE

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

 System.out.print("Enter your name: ");

 String name = input.nextLine();

 

 name = name.trim();

 

 if(name.equals(""))

     name = "stranger";

     

 System.out.println("Hello, " + name + "!");

}

}

Explanation:

import the Scanner class to be able to get input from the user

Create an object of the Scanner class called input

Ask the user to enter the name and set it to the name

Trim the name using trim() method, removes the whitespaces from the string

Check the name. If name is equal to "", set the name as stranger. This way if the name is empty, or just contains whitespaces or if name is not given, name will be set as stranger.

Print the name in required format

8 0
2 years ago
Which software programs should students avoid using to create and submit course work? (Choose all that apply.
mel-nik [20]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

You can submit your course work most often in a Word document. Because in the word document, you can insert text, numbers, images, charts, shapes whatever you want such as required for writing a course assignment or course work- easily.  Because your final work should be in a complete document.

The correct options to this question, that you should need to avoid using to create and submit course work are pages, numbers, and keynote.

Because while submitting the course work, you need to submit a complete word document, it is not required to you that you have to submit numbers, pages, or keynotes along with the course assignment. You can create a course assignment or project document in word and submit to your respective teacher. However, you can not create your course work using keynotes or pages, etc as given in the question.

4 0
1 year ago
Other questions:
  • HELP PLEASE ASAP brainliest to accurate
    14·2 answers
  • The number of operations executed by algorithms A and B is 40n2 and 2n3, respectively. Determine n0 such that A is better than B
    12·1 answer
  • QUESTION 9 of 10: Bob charged $200 for a plane ticket last month. When he received his statement, he saw that he could pay the m
    12·2 answers
  • Assume the availability of class named IMath that provides a static method, toThePowerOf which accepts two int arguments and ret
    10·1 answer
  • A good way to avoid skids is to _____ when coming into a turn. A. accelerate B. decelerate C. counter steer D. cover brake
    8·2 answers
  • When a program has several modules calling other modules, programmers often use a program ____, which operates similarly to an o
    5·1 answer
  • You have implemented a network where hosts are assigned specific roles, such as for file sharing and printing. Other hosts acces
    7·1 answer
  • Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within
    12·1 answer
  • Which statement is correct? a. choice of metric will influence the shape of the clusters b. choice of initial centroids will inf
    12·1 answer
  • Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!